package com.general.framework.web.config;

import com.general.framework.web.aop.GlobalExceptionHandler;
import com.general.framework.web.convert.StringToDateConverter;
import com.general.framework.data.redis.RedisCache;
import com.general.framework.data.redis.RedisLock;
import com.general.framework.web.utils.Springs;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author leejean
 * @ClassName: SpringWebAutoConfiguration
 * @Description: web工程配置
 * @date 2020年07月08 19:20:17
 */
@Configuration
public class SpringWebAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public GlobalExceptionHandler globalExceptionHandler() {
        return new GlobalExceptionHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public Springs springs() {
        return new Springs();
    }

    @Bean
    public StringToDateConverter stringToDateConverter() {
        return new StringToDateConverter();
    }

    @Bean
    public RedisCache redisCache() {
        return new RedisCache();
    }

    @Bean
    public RedisLock redisLock() {
        return new RedisLock();
    }

}
